﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Admin/Manager.Master" AutoEventWireup="true"
    CodeBehind="Gallery_Imager_Manager.aspx.cs" Inherits="Bilyteam_Website.Admin.WebForm5" %>

<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
    <div style="background-color: #F0FFF0;">
        <div style="float: left; width: 49%; height: 100%">
            <span style="display: inline-block; color: White; background-color: #4584AF; font-size: Large;
                font-weight: bold; height: 21px; width: 100%;" id="Span2">
                <asp:ScriptManager ID="ScriptManager1" runat="server">
                </asp:ScriptManager>
            </span>
            <asp:UpdatePanel ID="upDelete" runat="server">
                <ContentTemplate>
                    <asp:UpdatePanel ID="upUpdate" runat="server">
                        <ContentTemplate>
                            <asp:UpdatePanel ID="upAdd" runat="server">
                                <ContentTemplate>
                                    <table style="width: 100%; border-color: #0099CC; border-width: 2px; border-style: Ridge;
                                        background-color: #F0FFF0;">
                                        <tr>
                                            <td colspan="2">
                                                <div style="padding: 5px 0 5px 50px; margin: 10px 0 10px 0;">
                                                    <asp:Label ID="lblMessage" runat="server" Text="" CssClass="text-message"></asp:Label>
                                                    <asp:HiddenField ID="hdGalleryIDValue" runat="server" />
                                                </div>
                                            </td>
                                        </tr>
                                        <tr>
                                            <td style="width: 127px">
                                                <asp:Label ID="Label1" runat="server" Text="Gallery Name: " CssClass="text-message"></asp:Label>
                                                <br />
                                                <asp:TextBox ID="txtGalleryName" runat="server"></asp:TextBox>
                                            </td>
                                            <td>
                                                <asp:Label ID="Label2" runat="server" Text="Gallery Description: " CssClass="text-message"></asp:Label>
                                                <br />
                                                <asp:TextBox ID="txtGalleryDes" runat="server"></asp:TextBox>
                                            </td>
                                        </tr>
                                        <tr>
                                            <td style="width: 170px; height: 23px;">
                                                <div style="margin: 10px auto; height: 23px;">
                                                    <span style="width: 90px; height: 23px; float: left;">
                                                        <asp:Button ID="btnAdd" runat="server" Text="Add" Width="80px" Height="25px" OnClick="btnAdd_Click" />
                                                    </span><span style="width: 80px; height: 23px;">
                                                        <asp:Button ID="btnEdit" runat="server" Text="Update" Width="80px" Height="25px"
                                                            OnClick="btnEdit_Click" />
                                                    </span>
                                                </div>
                                            </td>
                                            <td>
                                                <div style="margin: 10px auto; height: 23px;">
                                                    <span style="width: 90px; height: 23px; float: left; margin-left: 5px;">
                                                        <asp:Button ID="btnDelete" runat="server" Text="Delete" Width="80px" Height="25px"
                                                            OnClick="btnDelete_Click" />
                                                    </span>
                                                </div>
                                            </td>
                                        </tr>
                                        <tr>
                                            <td colspan="2">
                                                <asp:DataList ID="dtlGalleries" DataKeyField="GalleryID" runat="server" RepeatDirection="Horizontal"
                                                    RepeatLayout="Flow" OnItemCommand="dtlGalleries_ItemCommand" OnItemDataBound="dtlGalleries_ItemDataBound">
                                                    <HeaderTemplate>
                                                        <div id="tableWrapper">
                                                            <table id="vsTable">
                                                                <tbody>
                                                                    <tr>
                                                                        <td class="title" style="width: 3%;">
                                                                            <div>
                                                                                ID</div>
                                                                        </td>
                                                                        <td class="title" style="width: 10%;">
                                                                            <div>
                                                                                Gallery Name</div>
                                                                        </td>
                                                                        <td class="title" style="width: 20%;">
                                                                            <div>
                                                                                Gallery Description</div>
                                                                        </td>
                                                                        <td class="title" style="width: 5%;">
                                                                            <div>
                                                                                Status</div>
                                                                        </td>
                                                                        <td class="title" style="width: 5%;">
                                                                            <div>
                                                                                Select</div>
                                                                        </td>
                                                                    </tr>
                                                    </HeaderTemplate>
                                                    <ItemStyle CssClass="EntryLine" />
                                                    <SelectedItemStyle CssClass="EntryLineHover" />
                                                    <ItemTemplate>
                                                        <tr>
                                                            <td class="cat" style="width: 3%;">
                                                                <div>
                                                                    <%# Eval("GalleryID") %>
                                                                    <asp:LinkButton ID="SelectButton" Text="Select" CommandName="Select" runat="server"
                                                                        Style="display: none" />
                                                                </div>
                                                            </td>
                                                            <td style="width: 10%;">
                                                                <div class="yes">
                                                                    <asp:Label ID="lblGalleryName" runat="server" Text='<%# Eval("GalleryName") %>'></asp:Label></div>
                                                            </td>
                                                            <td style="width: 20%;">
                                                                <div class="yes">
                                                                    <asp:Label ID="lblGalleryDes" runat="server" Text='<%# Eval("GalleryDescription") %>'></asp:Label></div>
                                                            </td>
                                                            <td style="width: 5%;">
                                                                <div class="yes">
                                                                    <%# Eval("Status") %>
                                                                    <asp:HiddenField ID="hdGalleryID" Value='<%# Eval("GalleryID") %>' runat="server" />
                                                                </div>
                                                            </td>
                                                            <td style="width: 5%;">
                                                                <div class="yes">
                                                                    <asp:Button ID="btnSelect" runat="server" Text="Select" />
                                                                </div>
                                                            </td>
                                                        </tr>
                                                    </ItemTemplate>
                                                    <FooterTemplate>
                                                                </tbody>
                                                            </table>
                                                        </div>
                                                    </FooterTemplate>
                                                </asp:DataList>
                                            </td>
                                        </tr>
                                    </table>
                                </ContentTemplate>
                                <Triggers>
                                    <asp:AsyncPostBackTrigger ControlID="btnAdd" />
                                </Triggers>
                            </asp:UpdatePanel>
                        </ContentTemplate>
                        <Triggers>
                            <asp:AsyncPostBackTrigger ControlID="btnEdit" />
                        </Triggers>
                    </asp:UpdatePanel>
                </ContentTemplate>
                <Triggers>
                    <asp:AsyncPostBackTrigger ControlID="btnDelete" />
                </Triggers>
            </asp:UpdatePanel>
        </div>
        <div style="float: right; width: 49%; height: 100%;">
            <span style="display: inline-block; color: White; background-color: #4584AF; font-size: Large;
                font-weight: bold; height: 21px; width: 100%;" id="Span1"></span>
            <asp:UpdatePanel ID="upDeleteImage" runat="server">
                <ContentTemplate>
                    <asp:UpdatePanel ID="upUpdateImage" runat="server">
                        <ContentTemplate>
                            <asp:UpdatePanel ID="upAddImage" runat="server">
                                <ContentTemplate>
                                    <table style="width: 100%; border-color: #0099CC; border-width: 2px; border-style: Ridge;
                                        background-color: #F0FFF0;">
                                        <tr>
                                            <td colspan="2">
                                                <div style="padding: 5px 0 5px 50px; margin: 10px 0 10px 0;">
                                                    <asp:Label ID="lblImageMessage" runat="server" Text="" CssClass="text-message"></asp:Label>
                                                    <asp:HiddenField ID="hdIDImageValue" runat="server" />
                                                    <asp:HiddenField ID="hdLocationValue" runat="server" />
                                                </div>
                                            </td>
                                        </tr>
                                        <tr>
                                            <td>
                                                <asp:Label ID="Label3" runat="server" Text="Image Name: " CssClass="text-message"></asp:Label>
                                                <br />
                                                <asp:TextBox ID="txtImageName" runat="server"></asp:TextBox>
                                            </td>
                                            <td>
                                                <asp:Label ID="Label4" runat="server" Text="Image Location: " CssClass="text-message"></asp:Label>
                                                <br />
                                                <asp:FileUpload ID="fupImage" runat="server" Style="height: 22px" />
                                            </td>
                                        </tr>
                                        <tr>
                                            <td style="width: 170px; height: 23px;">
                                                <div style="margin: 10px auto; height: 23px;">
                                                    <span style="width: 90px; height: 23px; float: left;">
                                                        <asp:Button ID="btnAddImage" runat="server" Text="Add" Width="80px" Height="25px"
                                                            OnClick="btnAddImage_Click" />
                                                    </span><span style="width: 80px; height: 23px;">
                                                        <asp:Button ID="btnUpdateImage" runat="server" Text="Update" Width="80px" Height="25px"
                                                            OnClick="btnUpdateImage_Click" />
                                                    </span>
                                                </div>
                                            </td>
                                            <td>
                                                <div style="margin: 10px auto; height: 23px;">
                                                    <span style="width: 90px; height: 23px; float: left; margin-left: 5px;">
                                                        <asp:Button ID="btnDeleteImage" runat="server" Text="Delete" Width="80px" 
                                                        Height="25px" onclick="btnDeleteImage_Click" />
                                                    </span>
                                                </div>
                                            </td>
                                        </tr>
                                        <tr>
                                            <td colspan="2">
                                                <asp:DataList ID="dtlImages" runat="server" DataKeyField="ImageID" RepeatDirection="Horizontal"
                                                    RepeatLayout="Flow" onitemcommand="dtlImages_ItemCommand" 
                                                    onitemdatabound="dtlImages_ItemDataBound">
                                                    <HeaderTemplate>
                                                        <div id="tableWrapper">
                                                            <table id="vsTable">
                                                                <tbody>
                                                                    <tr>
                                                                        <td class="title" style="width: 3%;">
                                                                            <div>
                                                                                ID</div>
                                                                        </td>
                                                                        <td class="title" style="width: 10%;">
                                                                            <div>
                                                                                Image Name</div>
                                                                        </td>
                                                                        <td class="title" style="width: 10%;">
                                                                            <div>
                                                                                Images Preview</div>
                                                                        </td>
                                                                        <td class="title" style="width: 5%;">
                                                                            <div>
                                                                                Status</div>
                                                                        </td>
                                                                        <td class="title" style="width: 5%;">
                                                                            <div>
                                                                                Select</div>
                                                                        </td>
                                                                    </tr>
                                                    </HeaderTemplate>
                                                    <ItemStyle CssClass="EntryLine" />
                                                    <SelectedItemStyle CssClass="EntryLineHover" />
                                                    <ItemTemplate>
                                                        <tr>
                                                            <td class="cat" style="width: 3%; height: 100px;">
                                                                <div>
                                                                    <%# Eval("ImageID") %>
                                                                    <asp:LinkButton id="SelectButton" 
                                                                                Text="Select" 
                                                                                CommandName="Select"
                                                                                runat="server"
                                                                                style="display:none"/>
                                                                </div>
                                                            </td>
                                                            <td style="width: 10%; height: 100px;">
                                                                <div class="yes">
                                                                    <asp:Label ID="lblImageName" runat="server" Text='<%# Eval("ImageName") %>'></asp:Label>
                                                                </div>
                                                            </td>
                                                            <td style="width: 10%; height: 100px;">
                                                                <div class="yes">
                                                                    <img src='../<%# Eval("Location") %>' width="180" height="100" alt="<%# Eval("ImageName") %>"
                                                                        title="<%# Eval("ImageName") %>" />
                                                                    <asp:HiddenField ID="hdLocation" Value='<%# Eval("Location") %>' runat="server" />
                                                                </div>
                                                            </td>
                                                            <td style="width: 5%; height: 100px;">
                                                                <div class="yes">
                                                                    <%# Eval("Status") %>
                                                                    <asp:HiddenField ID="hdImageID" Value='<%# Eval("ImageID") %>' runat="server" />
                                                                </div>
                                                            </td>
                                                            <td style="width: 5%; height: 100px;">
                                                                <div class="yes">
                                                                    <asp:Button ID="btnSelect" runat="server" Text="Select" />
                                                                </div>
                                                            </td>
                                                        </tr>
                                                    </ItemTemplate>
                                                    <FooterTemplate>
                                                        </tbody> </table> </div>
                                                    </FooterTemplate>
                                                </asp:DataList>
                                            </td>
                                        </tr>
                                    </table>
                                </ContentTemplate>
                                <Triggers>
                                    <asp:PostBackTrigger ControlID="btnAddImage" />
                                </Triggers>
                            </asp:UpdatePanel>
                        </ContentTemplate>
                        <Triggers>
                            <asp:PostBackTrigger ControlID="btnUpdateImage" />
                        </Triggers>
                    </asp:UpdatePanel>
                </ContentTemplate>
                <Triggers>
                    <asp:PostBackTrigger ControlID="btnDeleteImage" />
                </Triggers>
            </asp:UpdatePanel>
        </div>
        <div>
        </div>
    </div>
</asp:Content>
